xlv.obj.downloader={
	extend:function(){
		this.extend('xlv.obj.dmProcess');
	},
	implement:function(){
	},
	create:function(tag){
		var div=document.createElement((tag||'div'));
		div.setAttribute('xlvobject','xlv.obj.downloader');
		return div;			
	},
	properties:{
		dmName:null,
		methodName:'download',
		srcImg:null
	},
	method:{
		initial:function(){
			this.$super('xlv.obj.dmProcess.initial');
		},
		_makeActionString:function(){
			var qstr=null;
			if(this.$P.dmName){
				var dm=this.getDataModel(this.$P.dmName);
				if(dm){
					var node=dm.getNode(this.$P.methodName);
					if(node){
						qstr=xlv.util.methodNodeToQueryString(node);
						qstr=dm.$P._servlet+'/'+dm.$P.objectURL.replace(/\./g,'/')+'?'+qstr;
					}
				}
			}
			return qstr;
		},
		process:function(){
			this.valueMap();
			var action=this._makeActionString();
			if(action)document.location=action;
		},
		mvc_enableControl:function(dm){
			var enable;
			if(this.mvc_isModel(dm)){
				this.valueMap();
				var value=dm.getValue('properties.download.name');
				this.disabled=(value==null||value.strip().length==0);
			}
			return enable;
		}
	}
};
